#!/bin/sh

DAEMON="watchdog"
DAEMON_ARGS="-T ${watchdog_timeout:-60} ${watchdog_device:-/dev/watchdog}"
PIDFILE="/var/run/$DAEMON.pid"

. /usr/share/common

start() {
	echo_title "Starting watchdog"

	if [ "true" = "$watchdog_disabled" ]; then
		echo_error "$DAEMON is disabled"
		exit 1
	fi

	start_daemon
}

stop() {
	echo_title "Stopping watchdog"

	stop_daemon
}

case "$1" in
	start)
		start
		;;
	stop | kill)
		stop
		;;
	restart)
		stop
		sleep 1
		start
		;;
	*)
		echo "Usage: $0 {start|stop|restart}"
		exit 1
		;;
esac

exit 0
